home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / PUTENV.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  537 b   |  25 lines

  1. /* putenv.c --- BIBLE pp. 90-91 */
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. main(int argc, char **argv)
  5. {
  6.     char *value;
  7.     if(argc < 2)
  8.     {
  9.         printf("Usage :  %s <env_var_def.>\n", argv[0]);
  10.         exit(0);
  11.     }
  12.             /* Add new definition to the environment table */
  13.     strupr(argv[1]);
  14.     if (putenv(argv[1]) == -1)
  15.     {
  16.         printf("Error adding the definition:  %s\n",
  17.             argv[1]);
  18.     }
  19.     else
  20.     {
  21.         printf("Added to environment table :  %s\n", argv[1]);
  22.         printf("This definition will be gone once the program "
  23.                         "exits.\n");
  24.     }
  25. }